﻿using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace AudioPlayer.Plugin.Playback {
	/// <summary>
	/// Main playback.
	/// </summary>
	public interface IPlayback : IPlugin {
		#region Voids
		/// <summary>
		/// Play loaded file.
		/// </summary>
		void Play();
		/// <summary>
		/// Loads the specified URL.
		/// </summary>
		/// <param name="url">The URL.</param>
		void Load(String url);
		/// <summary>
		/// Loads the specified URL.
		/// </summary>
		/// <param name="url">The URL.</param>
		/// <param name="hwnd">The HWND.</param>
		void Load(String url, IntPtr hwnd);
		/// <summary>
		/// Pause playing.
		/// </summary>
		void Pause();
		/// <summary>
		/// Stop playing, and seek to zero.
		/// </summary>
		void Stop();
		/// <summary>
		/// Seeks the specified position.
		/// </summary>
		/// <param name="position">The position.</param>
		/// <param name="org">The origin.</param>
		void Seek(int position, SeekOrigin org);
		#endregion
		#region Events
		/// <summary>
		/// Occurs when playback starts.
		/// </summary>
		event EventHandler Starting;
		/// <summary>
		/// Occurs when playback ends.
		/// </summary>
		event EventHandler Ending;
		#endregion
		#region Property
		/// <summary>
		/// Gets a value indicating whether this instance can play.
		/// </summary>
		/// <value><c>true</c> if this instance can play; otherwise, <c>false</c>.</value>
		bool CanPlay { get; }
		/// <summary>
		/// Gets a value indicating whether this instance can seek.
		/// </summary>
		/// <value><c>true</c> if this instance can seek; otherwise, <c>false</c>.</value>
		bool CanSeek { get; }
		/// <summary>
		/// Gets a value indicating whether this instance can pause.
		/// </summary>
		/// <value><c>true</c> if this instance can pause; otherwise, <c>false</c>.</value>
		bool CanPause { get; }
		/// <summary>
		/// Gets a value indicating whether this instance can change balance.
		/// </summary>
		/// <value>
		/// 	<c>true</c> if this instance can change balance; otherwise, <c>false</c>.
		/// </value>
		bool CanChangeBalance { get; }
		/// <summary>
		/// Gets a value indicating whether this instance can change volume.
		/// </summary>
		/// <value>
		/// 	<c>true</c> if this instance can change volume; otherwise, <c>false</c>.
		/// </value>
		bool CanChangeVolume { get; }

		/// <summary>
		/// Gets or sets the volume.
		/// </summary>
		/// <value>The volume.</value>
		int Volume { get; set; }
		/// <summary>
		/// Gets or sets the balance.
		/// </summary>
		/// <value>The balance.</value>
		int Balance { get; set; }

		/// <summary>
		/// Gets the duration of playback.
		/// </summary>
		/// <value>The duration.</value>
		double Duration { get; }

		/// <summary>
		/// Gets the current position.
		/// </summary>
		/// <value>The current.</value>
		double Current { get; }
		/// <summary>
		/// Gets a value indicating whether this playback is playing.
		/// </summary>
		/// <value>
		/// 	<c>true</c> if playing is playing; otherwise, <c>false</c>.
		/// </value>
		bool IsPlaying { get; }
		#endregion
	}
}
